class Problem {
  String content;
  String name;
  String photo;
  int postId;
  int replyNum;
  String stuId;
  int thumbsUpNum;
  String time;

  Problem(this.name, this.stuId, this.content, this.thumbsUpNum, this.replyNum,
      this.time, this.photo);

  Problem.fromJson(Map<String, dynamic> json) {
    content = json['content'];
    name = json['name'];
    photo = json['photo'];
    postId = json['postId'];
    replyNum = json['replyNum'];
    stuId = json['stuId'];
    thumbsUpNum = json['thumbsUpNum'];
    time = json['time'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['content'] = this.content;
    data['name'] = this.name;
    data['photo'] = this.photo;
    data['postId'] = this.postId;
    data['replyNum'] = this.replyNum;
    data['stuId'] = this.stuId;
    data['thumbsUpNum'] = this.thumbsUpNum;
    data['time'] = this.time;
    return data;
  }
}

class ProblemList {
  List<Problem> data;
  ProblemList(this.data);
  factory ProblemList.formJson(List<dynamic> json){
    return ProblemList(
        json.map((i)=>Problem.fromJson((i))).toList()
    );
  }
}
